<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>0411-04 3D立方体</title>
    <style>
        body{
            perspective: 500px;
        }
        .box {
            width: 200px;
            height: 200px;
            /*border:1px solid #000;*/
            margin: 100px auto;
            transform-style:preserve-3d;
            position: relative;
            animation:gun 10s linear infinite;
            position: relative;

        }
        @keyframes gun {
            0%{
                transform: rotateY(0deg) rotateZ(0deg) rotateX(0deg);
                left:0;
                top:0
            }
            100%{
                transform: rotateY(360deg) rotateZ(360deg) rotateX(360deg);
                left:0px;
                top:0
            }
        }
        .box div{
            position: absolute;
            width:100%;
            height: 100%;
            text-align: center;
            line-height:200px;
            font-size:50px;
            left:0;
            top:0;
            background-image: linear-gradient(to right,rgba(255,255,255,.8),rgba(255,0,0,.9));
            border-bottom:1px solid yellow;
        }
        .box1{
            transform: translateZ(100px) rotateX(30deg);
            transform-origin: top;
        }
        .box2{
            transform: translateZ(-100px) rotateY(180deg) rotateX(30deg);
            transform-origin: top;
        }
        .box3{
            transform: translateX(-100px) rotateY(-90deg) rotateX(30deg);
            transform-origin: top;
        }
        .box4{
            transform: translateX(100px) rotateY(90deg) rotateX(30deg);
            transform-origin: top;
        }
        .box5{
            transform: translateY(-100px) rotateX(90deg);
        }
        .box6{
            transform: translateY(246px) rotateX(-90deg);
        }
        .box7{
            transform: translateY(173px) translateZ(200px) rotateX(-30deg);
            transform-origin: top;
        }
        .box8{
            transform: translateY(173px) translateZ(-200px) rotateY(180deg) rotateX(-30deg);
            transform-origin: top;
        }
        .box9{
            transform: translateY(173px) translateX(-200px) rotateY(-90deg) rotateX(-30deg);
            transform-origin: top;
        }
        .box10{
            transform: translateY(173px) translateX(200px) rotateY(90deg) rotateX(-30deg);
            transform-origin: top;
        }
    </style>
</head>
<body>
<div class="box">
    <div class="box1">上前</div>
    <div class="box2">上后</div>
    <div class="box3">上左</div>
    <div class="box4">上右</div>
    <div class="box5">上</div>
    <div class="box6">下</div>
    <div class="box7">下前</div>
    <div class="box8">下后</div>
    <div class="box9">下左</div>
    <div class="box10">下右</div>
</div>
</body>
</html>